-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[2.0.0] Fix issue with init I2C for esp32 S2 #4776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
SmartConfig and ETH need some work to adapt to the new API
…compilation while using WiFi library (#4550)
Actually without this fix I2C crash even with arduino IDE and most recent idf-release/v4.2.
|
You could probably fix it by adding:
I found the answer at espressif/esp-idf#6293 (comment) and tested it out successfully. |
Thats true, but next time when esp-idf will be updated with new parameter you will have to update this library, and again and again. This way of init variable is good practice: |
Ah, I get what you're saying. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and this fix worked for me.
I would say, use memset to set the whole struct to zero, not just the first element :) i2c_config_t conf;
memset(conf, 0, sizeof(i2c_config_t)); //Might require to #include "string.h" |
Well, i always thought it is the way to initialize all elements in struct with 0. |
The answer below that comment also gives some info. And given that this has caused issues on ESP32 before, I suggest you change it to memset :) |
as proposed in espressif/arduino-esp32#4776. Fixes `i2c_param_config` Errors with `esp-idf > 2020r3-8.4.0`
Hi, I am having a similar issue. I am trying to run the ESP-NOW protocol together with the I2C interface but I am getting an error. I am using the M5Stack ATOM, which uses the ESP32-PICO chip. This is what I am getting on the serial terminal.
I have tried adding this Can someone please advise on the fix to this issue ? |
No description provided.